<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
	<h1>会转义</h1>
	<h2>使用th:text获取后端数据(常用)</h2>
	<p th:text="${info}"></p>
	<h2>使用内联方式获取后端数据</h2>
	<p>[[${info}]]</p>
	<hr>
	<h1>不会转义</h1>
	<h2>传统方式th:utext</h2>
	<p th:utext="${info}"></p>
	<h2>使用内敛方式</h2>
	<p>[(${info})]</p>
	<hr>
	<h1>禁用内联</h1>
	<p th:inline="none">[[${name}]]</p>
	<p th:inline="none">[(${info})]</p>

<script type="text/javascript" th:inline="javascript">
    var jsname = [[${name}]];
    console.log("jsname=>" + jsname);
    var stuList = [[${students}]];
    for (var i = 0; i < stuList.length; i++) {
        var cur = stuList[i];
        console.log("i=" + i + ", id=" + cur.id + ", name=" + cur.name + ", age=" + cur.age);
	}
</script>
</body>
</html>